<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@taglib prefix="c" uri ="http://java.sun.com/jsp/jstl/core"%>
<%--使用taglib 引入标签库--%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>DASHMIN - Bootstrap Admin Template</title>
    <meta content="width=device-width, initial-scale=1.0" name="viewport">
    <link href="css/css2.css" rel="stylesheet">
    <link href="css/all.min.css" rel="stylesheet">
    <link href="css/bootstrap-icons.css" rel="stylesheet">
    <link href="css/owl.carousel.min.css" rel="stylesheet">
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">
</head>
<body>
<div class="container-fluid position-relative bg-white d-flex p-0">
    <div class="sidebar pe-4 pb-3">
        <nav class="navbar bg-light navbar-light">
            <a href="leave?action=list" class="navbar-brand mx-4 mb-3">
                <h3 class="text-primary">网上请假系统</h3>
            </a>
            <div class="navbar-nav w-100">
                <a href="leave?action=list" class="nav-item nav-link active">请假申请</a>
                <a href="leave?action=LeaveID" class="nav-item nav-link">填写请假申请</a>
            </div>
        </nav>
    </div>
    <div class="content">
        <nav class="navbar navbar-expand bg-light navbar-light px-4 py-0" style="height: 48px;">
            <form action="leave" method="get">
                <div class="d-none d-md-flex ms-4">
                    <input style="margin-top: 26px;width: 750px;background-color: #f0f0f0;" class="form-control border-0" type="text" name="courseID" id="courseID" placeholder="根据课程查询">
                    <button type="submit" class="btn btn-outline-primary" style="width: 80px;margin-top: 26px !important;margin-left: 5px;">查询</button>
                    <input type="hidden" name="action" value="seek">
                </div>
            </form>
            <form action="leave" method="get">
                <button type="submit" class="btn btn-outline-primary" style="width: 99px;margin-top: 25px !important;margin-left: 10px;">查看全部</button>
                <input type="hidden" name="action" value="list">
            </form>
            <div class="navbar-nav align-items-center ms-auto" style="">
                <div class="nav-item dropdown">
                    <a href="login.jsp" class="btn btn-outline-danger" style="margin-top: 17px; width: 65px; margin-left: 8px; display: inline-block;">退出</a>
                    <input type="hidden" name="action" value=".../login.jsp">
                </div>
            </div>
        </nav>

        <div class="shadow-sm p-3 mb-5 bg-white rounded">
            <div class="container-fluid pt-4 px-4" style="background-color: #efefef;">
                <div class="bg-light text-center rounded p-4" style="height: 630px !important;">
<%--                <form  action="leave" method="get">--%>
<%--                    <div class="d-flex align-items-center justify-content-between mb-4">--%>
<%--                        <a href="leave?action=list"><h6 class="mb-0">查看全部</h6></a>--%>

<%--                        <div class="d-none d-md-flex ms-4" style="height: 52px">--%>
<%--                            <input style="margin-top: 8px;" class="form-control border-0" type="text" name="courseID" id="courseID" placeholder="根据课程查询">--%>
<%--                            <button type="submit" class="btn btn-primary m-2" style="width: 100px">查询</button>--%>
<%--                            <input type="hidden" name="action" value="seek">--%>
<%--                        </div>--%>
<%--                    </div>--%>
<%--                </form>--%>
                <form>
                    <div class="table-responsive">
                        <table class="table text-start align-middle table-bordered table-hover mb-0">
                            <thead>
                            <tr class="text-dark">
                                <th scope="col"><input  type="checkbox"></th>
                                <th scope="col">请假单号</th>
                                <th scope="col">请假课程</th>
                                <th scope="col">请假天数</th>
                                <th scope="col">请假时间</th>
                                <th scope="col">状态</th>
                                <th scope="col"></th>
                            </tr>
                            </thead>
                            <tbody>
                            <c:forEach items="${leavelist}" var="leavelist">
                                <tr>
                                    <td><input  type="checkbox"></td>
                                    <td>${leavelist.leaveID}</td>
                                    <td>${leavelist.courseID}</td>
                                    <td>${leavelist.dayNum}</td>
                                    <td>${leavelist.applyTime}</td>
                                    <td style="color: ${leavelist.status == 1 ? 'green' : 'red'};">
                                        <c:choose>
                                            <c:when test="${leavelist.status == 1}">
                                                同意
                                            </c:when>
                                            <c:when test="${leavelist.status == 2}">
                                                不同意
                                            </c:when>
                                            <c:otherwise>
                                                待审核
                                            </c:otherwise>
                                        </c:choose>
                                    </td>
                                    <td><a href="leave?action=delete&leaveID=${leavelist.leaveID}"
                                           onclick="return confirm('您确定注销该请假申请')">注销</a>
                                    </td>
                                </tr>
                            </c:forEach>
                            </tbody>
                        </table>
                    </div>
                </form>
                </form>
            </div>
        </div>
        </div>
    </div>
</div>

<script src="js/jquery-3.4.1.min.js" type="4bebc94b2db97a1f9680a39f-text/javascript"></script>
<script src="js/bootstrap.bundle.min.js" type="4bebc94b2db97a1f9680a39f-text/javascript"></script>
<script src="js/chart.min.js" type="4bebc94b2db97a1f9680a39f-text/javascript"></script>
<script src="js/easing.min.js" type="4bebc94b2db97a1f9680a39f-text/javascript"></script>
<script src="js/waypoints.min.js" type="4bebc94b2db97a1f9680a39f-text/javascript"></script>
<script src="js/owl.carousel.min.js" type="4bebc94b2db97a1f9680a39f-text/javascript"></script>
<script src="js/moment.min.js" type="4bebc94b2db97a1f9680a39f-text/javascript"></script>
<script src="js/moment-timezone.min.js" type="4bebc94b2db97a1f9680a39f-text/javascript"></script>
<script src="js/tempusdominus-bootstrap-4.min.js" type="4bebc94b2db97a1f9680a39f-text/javascript"></script>

<script src="js/main.js" type="4bebc94b2db97a1f9680a39f-text/javascript"></script>
<script src="js/rocket-loader.min.js" data-cf-settings="4bebc94b2db97a1f9680a39f-|49" defer=""></script></body>
</html>